<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			//求1 + 2！ + 3！ + 4！....+20!的值
			// - 2！ = 2 * 1
			// - 3！ = 3 * 2 * 1

			var sum = 1;
			var num = 0;
			for (var i = 1; i <= 20; i++) {
				sum *= i;
				num += sum;
				console.log(num);
			}
		</script>
	</body>
</html>
